package com.treasure.service.constant;


import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 
 * @version 1.0 
 * @author panxinwen 2018/11/2 13:42
 * @Copyright © 2015 | 武汉京航科技有限公司 Email:19919866605@163.com
 * */

public enum ResultType {
  PROCESSING("PROCESSING"),SUCCESS("SUCCESS"), ERROR("ERROR"), PARAMETERS_ERROR("PARAMETERS_ERROR"), USAGE_UNAVAILABLE_AMOUNT("USAGE_UNAVAILABLE_AMOUNT"), FROZEN_UNAVAILABLE_AMOUNT("FROZEN_UNAVAILABLE_AMOUNT"), ORDER_ERROR("ORDER_ERROR");
  private String desc;

  private ResultType(String desc) {
    this.desc = desc;
  }

  public String getDesc() {
    return this.desc;
  }

  private static final Map<String, ResultType> typeMap;

  static {
    Map<String, ResultType> resultTypeMap = new HashMap<>();
    for (ResultType resultType : ResultType.values()) {
      resultTypeMap.put(resultType.desc, resultType);
    }
    typeMap = Collections.unmodifiableMap(resultTypeMap);
  }

  public static ResultType getResultType(String desc) {
    return typeMap.get(desc);
  }
}
